<?php 

$NoFilm = $_POST['NoFilm'];
$mois = 60 * 60 * 24 * 31;

if (! isset($_COOKIE['selection'])) {
    setcookie('selection[0]','1', time()+ $mois);
    setcookie('selection[1]',"$NoFilm", time()+ $mois);
}
else {
    $selection = $_COOKIE['selection'];
    $nextPos = $selection[0] + 1;
    setcookie('selection[0]',$nextPos, time()+ $mois);
    setcookie("selection[$nextPos]","$NoFilm", time()+ $mois);
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Panier</title>
        <link href="style.css" rel="stylesheet" type="text/css" />

        <SCRIPT TYPE="text/javascript">

            function popupform(myform, windowname)
            {
                if (! window.focus)return true;
                window.open('', windowname, 'height=500,width=550,scrollbars=yes');
                myform.target=windowname;
                return true;
            }

        </SCRIPT>


    </head>

    <body>
        <div class="center">
        <div class="wrap header">
            <!--ENTETE-->
            <hr/>
            <h1>PANIER</h1>
            <h2>Auteur: Nguyen Tat Son Tung </h2>
            <hr/>
            <!--FIN D'ENTETE-->
        </div>

        <div class="wrap main">
        <div class="wrap main_r">
        <div class="wrap main_content_max" id="main_content">
            <div class="content">
                <table class="blog" cellpadding="0" cellspacing="0">
                    <tr><td valign="top"><div>

                                <table class="contentpaneopen"><tr>
                                <td class="contentheading" width="100%"><img src="images/shopping-cart-up.png">  PANIER </td></tr></table>
                                <table class="contentpaneopen"><tr><td valign="top" colspan="2">
                                            <br /><br />
                                            <div align="center"><h2> Film num&eacute;ro <?php echo $_POST['NoFilm'] ?> ajout&eacute;. </h2></div>
                                            <br /><br />
                                </td></tr></table>

                                <span class="article_separator">&nbsp;</span>
                                <form method="POST" action="VoirSelection.php" onSubmit="popupform(this, 'join')">
                                    <input name="VoirSelection" type="image" src="images/info.png" title="Voir la s&eacute;lection" value="Voir la s&eacute;lection" /><h2> Voir la s&eacute;lection</h2>
                                </form>
                </div></td></tr></table>
            </div>
        </div>


    </body>
</html>